package com.touni.designpattern.compositepattern;

import lombok.Data;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName : Employee
 * @Description :
 * @Author : lwq
 * @Date: 2020-11-12 08:57
 */
@Data
@ToString
public class Employee {
    private String name;
    private String dept;
    private int salary;
    private List<Employee> employeeList;

    public Employee(String name, String dept, int salary){
        this.name = name;
        this.dept = dept;
        this.salary = salary;
        this.employeeList = new ArrayList<>();
    }

    public void addList(Employee employee){
        this.employeeList.add(employee);
    }

    public void removeList(Employee employee){
        this.employeeList.remove(employee);
    }

}
